<html xmlns:tomboy="http://beatniksoftware.com/tomboy" xmlns:link="http://beatniksoftware.com/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size"><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><title>git init</title><style type="text/css">
        
	body {  }
	h1 { font-size: xx-large;
     	     font-weight: bold;
     	     border-bottom: 1px solid black; }
	div.note {
		   position: relative;
		   display: block;
		   padding: 5pt;
		   margin: 5pt; 
		   white-space: -moz-pre-wrap; /* Mozilla */
 	      	   white-space: -pre-wrap;     /* Opera 4 - 6 */
 	      	   white-space: -o-pre-wrap;   /* Opera 7 */
 	      	   white-space: pre-wrap;      /* CSS3 */
 	      	   word-wrap: break-word;      /* IE 5.5+ */ }
	</style></head><body><div class="note" id="git init"><a name="git init"></a><h1>git init</h1>
sudo apt-get install git

mkdir work/proj

git init 

ls -a 

touch README

git status 

git add README

git commit -m "1st"

git config  --global user.name "Johnathan"
git config --global user.email "<a style="color:#3465A4" href="rc.6688@hotmail.com&quot;">rc.6688@hotmail.com"</a>

cat <a style="color:#3465A4" href="~/.gitconfig">~/.gitconfig</a>

vim README
git add README
git commit -m "see if the name is right?"
git log
git log -p   查看修改的内容pat<strike>
</strike>sudo apt-get install tig


touch main.c

git commit -a -m ""  此处的-a只是跟踪已经添加过的跟踪，新文件不会自动跟踪

git diff 查看更改

git commit -a 可以添加多行注释文本，默认是nano编辑器
git config --global  core.editor vim 设置默认编辑器

git commit -a -v -m ""  可以查看提交的不同版本<strike>

</strike>git config --global alias.ci “commit -a -v”

cat <a style="color:#3465A4" href="~/.gitconfig">~/.gitconfig</a>


</div></body></html>